
package GUI;

public class JanelaPrincipal extends javax.swing.JFrame {

    protected ControladorJanelaPrincipal cJP;

    public JanelaPrincipal() {
        initComponents();
        setLocationRelativeTo(null);
    }

    /**
     * A JanelaPrincial é reconhecida pela Classe Principal
     */
    public void setControladorJanelaPrincipal(ControladorJanelaPrincipal c){
        cJP = c;
        botaoGerenciarCliente.addActionListener(cJP);
        botaoGerenciarConsorcio.addActionListener(cJP);
        botaoSair.addActionListener(cJP);

    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        botaoGerenciarCliente = new javax.swing.JButton();
        botaoGerenciarConsorcio = new javax.swing.JButton();
        botaoSair = new javax.swing.JButton();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenuItem5 = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Traxx Motos - Controle de Clientes");
        setResizable(false);

        jPanel1.setBackground(new java.awt.Color(0, 0, 153));

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/GUI/461.jpg"))); // NOI18N
        jLabel1.setText(".");

        jPanel2.setBackground(new java.awt.Color(204, 204, 204));
        jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        botaoGerenciarCliente.setBackground(new java.awt.Color(255, 255, 255));
        botaoGerenciarCliente.setFont(new java.awt.Font("Arial", 1, 11));
        botaoGerenciarCliente.setIcon(new javax.swing.ImageIcon(getClass().getResource("/GUI/Cliente2.jpeg"))); // NOI18N
        botaoGerenciarCliente.setText("Gerenciar Cliente");
        botaoGerenciarCliente.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botaoGerenciarCliente.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        botaoGerenciarCliente.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        botaoGerenciarCliente.addActionListener(cJP);

        botaoGerenciarConsorcio.setBackground(new java.awt.Color(255, 255, 255));
        botaoGerenciarConsorcio.setFont(new java.awt.Font("Arial", 1, 11));
        botaoGerenciarConsorcio.setIcon(new javax.swing.ImageIcon(getClass().getResource("/GUI/imagestraxx.jpeg"))); // NOI18N
        botaoGerenciarConsorcio.setText("Gerenciar Consórcio");
        botaoGerenciarConsorcio.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botaoGerenciarConsorcio.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        botaoGerenciarConsorcio.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);

        botaoSair.setBackground(new java.awt.Color(255, 255, 255));
        botaoSair.setFont(new java.awt.Font("Arial", 1, 11));
        botaoSair.setIcon(new javax.swing.ImageIcon(getClass().getResource("/GUI/Índice2.jpeg"))); // NOI18N
        botaoSair.setText("Sair");
        botaoSair.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        botaoSair.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        botaoSair.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(botaoGerenciarCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(botaoGerenciarConsorcio)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(botaoSair, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(213, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(botaoSair, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(botaoGerenciarCliente, javax.swing.GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
                    .addComponent(botaoGerenciarConsorcio, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(8, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(4, 4, 4)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 462, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jMenuBar1.setBackground(new java.awt.Color(204, 204, 204));

        jMenu1.setBackground(new java.awt.Color(204, 204, 255));
        jMenu1.setText("Arquivo");

        jMenuItem1.setBackground(new java.awt.Color(204, 204, 255));
        jMenuItem1.setText("Sair");
        jMenu1.add(jMenuItem1);

        jMenuBar1.add(jMenu1);

        jMenu2.setBackground(new java.awt.Color(204, 204, 255));
        jMenu2.setText("Gerenciar");

        jMenuItem2.setBackground(new java.awt.Color(204, 204, 255));
        jMenuItem2.setText("Gerenciar Cliente");
        jMenu2.add(jMenuItem2);

        jMenuItem3.setBackground(new java.awt.Color(204, 204, 255));
        jMenuItem3.setText("Gerenciar Consórcio");
        jMenu2.add(jMenuItem3);

        jMenuBar1.add(jMenu2);

        jMenu3.setBackground(new java.awt.Color(204, 204, 255));
        jMenu3.setText("Diversos");

        jMenuItem4.setBackground(new java.awt.Color(204, 204, 255));
        jMenuItem4.setText("Verificar melhores meses de venda");
        jMenu3.add(jMenuItem4);

        jMenuItem5.setBackground(new java.awt.Color(204, 204, 255));
        jMenuItem5.setText("Verificar melhores localidades de venda");
        jMenu3.add(jMenuItem5);

        jMenuBar1.add(jMenu3);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 618, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

   
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton botaoGerenciarCliente;
    private javax.swing.JButton botaoGerenciarConsorcio;
    private javax.swing.JButton botaoSair;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    // End of variables declaration//GEN-END:variables

   public String getBotaoGerenciarCliente(){
        return botaoGerenciarCliente.getName();
   }

   public String getBotaoGeremciarConsorcio(){
    return botaoGerenciarConsorcio.getName();
   }
}
